<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Aquamat: Dokumentacja pliku outputs.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Wygenerowano przez Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Strona&nbsp;główna</span></a></li>
      <li><a href="pages.html"><span>Dodatkowe&nbsp;strony</span></a></li>
      <li><a href="annotated.html"><span>Struktury&nbsp;Danych</span></a></li>
      <li class="current"><a href="files.html"><span>Pliki</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>Lista&nbsp;plików</span></a></li>
      <li><a href="globals.html"><span>Globalne</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Dokumentacja pliku outputs.c</h1><h3>(r58/r57)</h3>
<p>Implementacja obsługi wyjść.  
<a href="#_details">Więcej...</a></p>
<code>#include &quot;<a class="el" href="aquamat_8h_source.html">aquamat.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="outputs_8h_source.html">outputs.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="io_8h_source.html">io.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="usart_8h_source.html">usart.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="strings_8h_source.html">strings.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="eeprom_8h_source.html">eeprom.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="temp_8h_source.html">temp.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="log_8h_source.html">log.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="hd44780_8h_source.html">hd44780.h</a>&quot;</code><br/>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Funkcje</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a87b4ebc79556159d67e92592a89138e0">outputs_init</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#ae8579dc464916362d15d5c3ef3d7db56">outputs_update</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a548083cd691983a308f7c1af01d6a079">output_check_flag</a> (uint8_t id, uint8_t flag)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a9ee1a605373369cd9aca9e3c10968c9d">output_set_flag</a> (uint8_t id, uint8_t flag, uint8_t state)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#ae6e36c14e65fec76fe90e47c21b17adb">output_block_override</a> (uint8_t id)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#af57fa32641f84fe26d29e350ea094cc6">output_set</a> (uint8_t id, uint8_t state)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a1799849f7fe619290f7a47601e5f4f32">output_toggle</a> (uint8_t id)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#aee96164cfca110d2428bcccd99d7c842">outputs_all</a> (uint8_t state)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a6d934b6b688afc965147161462788b63">outputs_block_all</a> (uint8_t state)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#ab0e2563301fbacc8e2b5736475521aca">outputs_assign</a> (uint8_t *out, uint8_t id)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a7d089f1a3a997268cdf5c9e8abfd5337">output_switch</a> (uint8_t id, uint8_t state)</td></tr>
<tr><td colspan="2"><h2>Zmienne</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structOUTPUT.html">OUTPUT</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a8d5107318b3115c16d81315e03e99428">outputs</a> [OUTPUTS_NUM]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#ac03ca8a68bb63c8bb25dbfba54096100">outputs_flags</a> = UINT8_T_DISABLED</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="ui_8c.html#a200eaeded377a7a8d9222c3eb6d0031d">PROGMEM</a> const uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="outputs_8c.html#a07cbc5dab5ba460ed8f36e5f667176ca">OUTPUTS_DEVICES_ADDRS</a> []</td></tr>
</table>
<hr/><a name="_details"></a><h2>Opis szczegółowy</h2>
<p>Implementacja obsługi wyjść. </p>
<h2><a class="anchor" id="out_devices">
Układy wyjściowe.</a></h2>
<p>Sterowanie układami zewnętrznymi opiera się o magistralę I2C oraz układy z rodziny PCF8574. Dla programu układy wyjściowe widoczne są jako numer wyjścia. Pierwsze osiem wyjść jest typu LV (wyjście poprzez układ ULN2803), druga ósemka wyjść jest typu HV (bezpośrednie wyjście z układu PCF) i wymaga podłączenia dodatkowego układu wykonawczego (triaki lub przekaźniki).</p>
<p>Jeżeli zewnętrzny układ wykonawczy będzie podłączony poprzez złącze DB9 znaczenie poszczególnych pinów przedstawiono na poniższym rysunku:</p>
<div align="center">
<img src="control_connector.jpg" alt="control_connector.jpg"/>
</div>
 <hr/><h2>Dokumentacja funkcji</h2>
<a class="anchor" id="ae6e36c14e65fec76fe90e47c21b17adb"></a><!-- doxytag: member="outputs.c::output_block_override" ref="ae6e36c14e65fec76fe90e47c21b17adb" args="(uint8_t id)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void output_block_override </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Przełącza przeładowanie blokowania </p>
<dl><dt><b>Parametry:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>numer wyjścia </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a548083cd691983a308f7c1af01d6a079"></a><!-- doxytag: member="outputs.c::output_check_flag" ref="a548083cd691983a308f7c1af01d6a079" args="(uint8_t id, uint8_t flag)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t output_check_flag </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>flag</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sprawdza poszczególne flagi </p>
<dl><dt><b>Parametry:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>numer wyjścia </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>flag</em>&nbsp;</td><td>flaga </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af57fa32641f84fe26d29e350ea094cc6"></a><!-- doxytag: member="outputs.c::output_set" ref="af57fa32641f84fe26d29e350ea094cc6" args="(uint8_t id, uint8_t state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void output_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>state</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Włącza lub wyłącza wyjście </p>
<dl><dt><b>Parametry:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>numer wyjścia </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>state</em>&nbsp;</td><td>docelowy stan </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9ee1a605373369cd9aca9e3c10968c9d"></a><!-- doxytag: member="outputs.c::output_set_flag" ref="a9ee1a605373369cd9aca9e3c10968c9d" args="(uint8_t id, uint8_t flag, uint8_t state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void output_set_flag </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>state</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Ustawia poszczególne flagi </p>
<dl><dt><b>Parametry:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>numer wyjścia </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>flag</em>&nbsp;</td><td>flaga </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>state</em>&nbsp;</td><td>stan </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a7d089f1a3a997268cdf5c9e8abfd5337"></a><!-- doxytag: member="outputs.c::output_switch" ref="a7d089f1a3a997268cdf5c9e8abfd5337" args="(uint8_t id, uint8_t state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void output_switch </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>state</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Włącza lub wyłącza wyjście sprawdzając najpierw stan blokady. </p>
<dl><dt><b>Parametry:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>numer wyjścia </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>state</em>&nbsp;</td><td>operacja do wykonania <a class="el" href="commonDefs_8h.html#ad76d1750a6cdeebd506bfcd6752554d2">ON</a> lub <a class="el" href="commonDefs_8h.html#a29e413f6725b2ba32d165ffaa35b01e5">OFF</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1799849f7fe619290f7a47601e5f4f32"></a><!-- doxytag: member="outputs.c::output_toggle" ref="a1799849f7fe619290f7a47601e5f4f32" args="(uint8_t id)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void output_toggle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Zmienia stan wyjścia na przeciwny. </p>
<dl><dt><b>Parametry:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>numer wyjścia </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aee96164cfca110d2428bcccd99d7c842"></a><!-- doxytag: member="outputs.c::outputs_all" ref="aee96164cfca110d2428bcccd99d7c842" args="(uint8_t state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outputs_all </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>state</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Wyłącza/włącza wszystkie wyjścia. </p>

</div>
</div>
<a class="anchor" id="ab0e2563301fbacc8e2b5736475521aca"></a><!-- doxytag: member="outputs.c::outputs_assign" ref="ab0e2563301fbacc8e2b5736475521aca" args="(uint8_t *out, uint8_t id)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outputs_assign </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&nbsp;</td>
          <td class="paramname"> <em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>id</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Przyporządkowuje identyfikator wyjścia </p>

</div>
</div>
<a class="anchor" id="a6d934b6b688afc965147161462788b63"></a><!-- doxytag: member="outputs.c::outputs_block_all" ref="a6d934b6b688afc965147161462788b63" args="(uint8_t state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outputs_block_all </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>state</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Blokuje odblokowuje wszystkie wyjścia. </p>

</div>
</div>
<a class="anchor" id="a87b4ebc79556159d67e92592a89138e0"></a><!-- doxytag: member="outputs.c::outputs_init" ref="a87b4ebc79556159d67e92592a89138e0" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outputs_init </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Inicjalizuje flagi wyjść. Wyłącza i blokuje wyjścia. </p>

</div>
</div>
<a class="anchor" id="ae8579dc464916362d15d5c3ef3d7db56"></a><!-- doxytag: member="outputs.c::outputs_update" ref="ae8579dc464916362d15d5c3ef3d7db56" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outputs_update </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>W przypadku kiedy flaga <a class="el" href="outputs_8h.html#a92a63185420f852823d2623ca57a606c">OUTPUTS_CHANGE_FLAG</a> w jest ustawiona należy zaktualizować stan wyjść. </p>

</div>
</div>
<hr/><h2>Dokumentacja zmiennych</h2>
<a class="anchor" id="a8d5107318b3115c16d81315e03e99428"></a><!-- doxytag: member="outputs.c::outputs" ref="a8d5107318b3115c16d81315e03e99428" args="[OUTPUTS_NUM]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structOUTPUT.html">OUTPUT</a> <a class="el" href="outputs_8h.html#a04eafc79613066e5e3f2be01ce7f5cb0">outputs</a>[]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tablica przechowująca stan wyjść. </p>

</div>
</div>
<a class="anchor" id="a07cbc5dab5ba460ed8f36e5f667176ca"></a><!-- doxytag: member="outputs.c::OUTPUTS_DEVICES_ADDRS" ref="a07cbc5dab5ba460ed8f36e5f667176ca" args="[]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const uint8_t <a class="el" href="ui_8c.html#a200eaeded377a7a8d9222c3eb6d0031d">PROGMEM</a> <a class="el" href="outputs_8c.html#a07cbc5dab5ba460ed8f36e5f667176ca">OUTPUTS_DEVICES_ADDRS</a>[]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Wartość początkowa:</b><div class="fragment"><pre class="fragment"> {
    <a class="code" href="outputs_8h.html#a0efa4989428b387feda9ae6b90404425">OUTPUTS_DEVICE_LV_ADDR</a>,
    <a class="code" href="outputs_8h.html#ae004f3f2fef511dc448646268dcd27f6">OUTPUTS_DEVICE_HV_ADDR</a>
}
</pre></div><p>Przechowuje informacje o adresach I2C układów wyjściowych. </p>

</div>
</div>
<a class="anchor" id="ac03ca8a68bb63c8bb25dbfba54096100"></a><!-- doxytag: member="outputs.c::outputs_flags" ref="ac03ca8a68bb63c8bb25dbfba54096100" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="outputs_8h.html#ac03ca8a68bb63c8bb25dbfba54096100">outputs_flags</a> = UINT8_T_DISABLED</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Rejestr flag związanych z obsługą wyjść. </p>

</div>
</div>
</div>
<hr size="1">
<div style="text-align: center;">
<small>Projekt udostępniony jest na zasadach Open Source. Zapoznaj się z warunkami licencji w pliku COPYING znajdujacym się w katalogu głównym.	</small>
</div>

<hr size="1">
<div style="text-align: center;">
Aquamat - sterownik akwarystyczny Open Source
<br/>
Copyright (C) 2009  <a href="http://todryk.pl">Wojciech Todryk</a> (wojciech(at)todryk(dot)pl)
</div>

<div style="text-align: right;">
<small>Dokumentację wygenerowano za pomocą programu&nbsp;</small>
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a>
<small> wersja 1.6.1 (Fri Apr 23 22:48:16 2010)&nbsp;</small>
</div>
